package com.ubb.damate.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the file database table.
 * 
 */
@Embeddable
public class FilePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="FileName", unique=false, nullable=false, length=255)
	private String fileName;

	@Column(name="ProjectName", unique=false, nullable=false, length=255)
	private String projectName;

	@Column(name="WorkspaceId", unique=false, nullable=false)
	private int workspaceId;

    public FilePK() {
    }
	public String getFileName() {
		return this.fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getProjectName() {
		return this.projectName;
	}
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	public int getWorkspaceId() {
		return this.workspaceId;
	}
	public void setWorkspaceId(int workspaceId) {
		this.workspaceId = workspaceId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof FilePK)) {
			return false;
		}
		FilePK castOther = (FilePK)other;
		return 
			this.fileName.equals(castOther.fileName)
			&& this.projectName.equals(castOther.projectName)
			&& (this.workspaceId == castOther.workspaceId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.fileName.hashCode();
		hash = hash * prime + this.projectName.hashCode();
		hash = hash * prime + this.workspaceId;
		
		return hash;
    }
}